<?php

class Sistema_Form_Aluno extends Zend_Form
{

    public function init()
    {
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $module = $front->getRequest()->getModuleName();
        $url = $front->getBaseUrl().'/'.$module.'/'.$controller;
        
        
        $this->setName('form_aluno');
        
        $el = new Zend_Form_Element_Hidden('ALU_ID',array('disableLoadDefaultDecorators' =>true));
        $el->addDecorators(array(array('ViewHelper'),array('Errors')))->addFilter('Int');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_NOM');
        $el->setLabel('Nome')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        
        $el = new Zend_Form_Element_Text('ALU_CPF');
        $el->setLabel('CPF')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','cpf');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_RG');
        $el->setLabel('RG')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('maxLength', 10);
        $el->setAttrib('class','rg');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_DATNAS');
        $el->setLabel('Data Nascimento')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','data');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_CEP');
        $el->setLabel('CEP')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','cep');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_END');
        $el->setLabel('Endereço')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','res_endereco');
        $el->setAttrib('required','');
        $this->addElement($el);        
        
        
        $el = new Zend_Form_Element_Text('ALU_BAI');
        $el->setLabel('Bairro')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','res_bairro');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_CID');
        $el->setLabel('Cidade')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','res_cidade');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_UF');
        $el->setLabel('UF')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','uf res_uf');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_TEL');
        $el->setLabel('Telefone')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','telefone');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_CEL');
        $el->setLabel('Celular')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','telefone');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_EML');
        $el->setLabel('E-mail')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_FCB');
        $el->setLabel('Facebook')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_PAINOM');
        $el->setLabel('Nome do Pai')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_PAICPF');
        $el->setLabel('CPF')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','cpf');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_PAIDATNAS');
        $el->setLabel('Data de Nascimento')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','data');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_PAIPRF');
        $el->setLabel('Profissão')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_MAENOM');
        $el->setLabel('Nome da Mãe')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_MAECPF');
        $el->setLabel('CPF')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','cpf');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_MAEDATNAS');
        $el->setLabel('Data de Nascimento')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','data');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('ALU_MAEPRF');
        $el->setLabel('Profissão')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('required','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Checkbox('ALU_STA',array('checked'=>'checked'));
        $el->setLabel('Status Aluno');
        $this->addElement($el);
        
        $btn = new Zend_Form_Element_Submit('gravar',array('disableLoadDefaultDecorators' =>true));
        $btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setLabel('Salvar');
        $btn->setAttrib('id', 'submitbutton');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
        $btn = new Zend_Form_Element_Button('Cancelar',array('disableLoadDefaultDecorators' =>true));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<a href="'.$url.'" class="btn-frm">Voltar</a>');
        $btn->setAttrib('id', 'btncancel');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
    }


}


